import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

import Components from 'unplugin-vue-components/vite'//这里
import AutoImport from 'unplugin-auto-import/vite'//这里

import path from 'path'

import {
  ElementPlusResolver
} from 'unplugin-vue-components/resolvers'//这里

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue(),
    AutoImport({//这里
      resolvers: [ElementPlusResolver()],
    }),
    Components({//这里
      resolvers: [ElementPlusResolver()],
    }),],
    resolve: {
      // 配置路径别名
      alias: {
        '@': path.resolve(__dirname, './src'),
      },
    },
  server: {
      host: '0.0.0.0',
      port: '9090',
      open: true
    },
})
